package com.sky.service.common.impl;

import com.hxc.pay.wx.service.RefundSuccessService;
import com.sky.constant.PayStatusConstant;
import com.sky.mapper.common.OrdersMapper;
import com.sky.pojo.Orders;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author zgp
 * @version V1.0
 * @date 2025-02-07 16:37
 */
@Service
public class RefundSuccessServiceImpl implements RefundSuccessService {
    @Autowired
    private OrdersMapper ordersMapper;

    /**
     * 退款成功通知
     *
     * @param outTradeNo 商户订单号
     */
    @Override
    public void success(String outTradeNo) {
       // 修改订单支付状态：已退款
        Orders orders = Orders.builder()
                .number(outTradeNo)
                .payStatus(PayStatusConstant.REFUND)
                .build();
        ordersMapper.updateByNumber(orders);
    }

}
